<template>
    <div>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="status" label="取消状态">
            </el-table-column>
            <el-table-column prop="name" label="姓名">
            </el-table-column>
            <el-table-column prop="province" label="省份">
            </el-table-column>
            <el-table-column prop="city" label="市区">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
            <el-table-column prop="zip" label="邮编">
            </el-table-column>
            <el-table-column label="操作" width="280" >
                <template slot-scope="scope">
                    <el-button  type="text" size="small">查看</el-button>
                    <el-button type="text" size="small">编辑</el-button>
                    <el-button v-if="(scope.row.status=='审核中'||scope.row.status=='财务审核')&&hasPermission('204')&&hasPermission('2076')"  type="text" size="small">去审核(205,206)</el-button>
                    <el-button v-else-if="scope.row.status=='审核中'&&hasPermission('204')"  type="text" size="small">去审核(205)</el-button>
                    <el-button v-else-if="scope.row.status=='财务审核'&&hasPermission('206')"  type="text" size="small">去审核(206)</el-button>

                </template>
            </el-table-column>
        </el-table>

    </div>
</template>

<script>
export default {
    data() {
        return {
            tableData: [{
                status: '审核中',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                status: '财务审核',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1517 弄',
                zip: 200333
            }, {
                status: '未开始',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1519 弄',
                zip: 200333
            }, {
                status: '已开始',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1516 弄',
                zip: 200333
            }]

        }
    },
    methods: {
        hasPermission(val){
            console.log(val,'val');
            if(val =='205'){
                console.log(111);
                return true
            }else if(val=='206'){
                console.log(222);
                return true
            }else{
                console.log(333);
                return false
            }

        }

    },
    created() {

    },
}
</script>
<style scoped></style>